.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: GPL-3.0-or-later
.\"
.TH proc_pid_pagemap 5 2024-05-02 "Linux man-pages 6.9.1"
.SH NAME
/proc/pid/pagemap \- mapping of virtual pages
.SH DESCRIPTION
.TP
.IR /proc/ pid /pagemap " (since Linux 2.6.25)"
This file shows the mapping of each of the process's virtual pages
into physical page frames or swap area.
It contains one 64-bit value for each virtual page,
with the bits set as follows:
.RS
.TP
63
If set, the page is present in RAM.
.TP
62
If set, the page is in swap space
.TP
61 (since Linux 3.5)
The page is a file-mapped page or a shared anonymous page.
.TP
60\[en]58 (since Linux 3.11)
Zero
.\" Not quite true; see commit 541c237c0923f567c9c4cabb8a81635baadc713f
.TP
57 (since Linux 5.14)
If set, the page is write-protected through
.BR userfaultfd (2).
.TP
56 (since Linux 4.2)
.\" commit 77bb499bb60f4b79cca7d139c8041662860fcf87
.\" commit 83b4b0bb635eee2b8e075062e4e008d1bc110ed7
The page is exclusively mapped.
.TP
55 (since Linux 3.11)
PTE is soft-dirty
(see the kernel source file
.IR Documentation/admin\-guide/mm/soft\-dirty.rst ).
.TP
54\[en]0
If the page is present in RAM (bit 63), then these bits
provide the page frame number, which can be used to index
.I /proc/kpageflags
and
.IR /proc/kpagecount .
If the page is present in swap (bit 62),
then bits 4\[en]0 give the swap type, and bits 54\[en]5 encode the swap offset.
.RE
.IP
Before Linux 3.11, bits 60\[en]55 were
used to encode the base-2 log of the page size.
.IP
To employ
.IR /proc/ pid /pagemap
efficiently, use
.IR /proc/ pid /maps
to determine which areas of memory are actually mapped and seek
to skip over unmapped regions.
.IP
The
.IR /proc/ pid /pagemap
file is present only if the
.B CONFIG_PROC_PAGE_MONITOR
kernel configuration option is enabled.
.IP
Permission to access this file is governed by a ptrace access mode
.B PTRACE_MODE_READ_FSCREDS
check; see
.BR ptrace (2).
.SH SEE ALSO
.BR proc (5)
